import Vue from 'vue'
import router from '@/router'
import App from './App.vue'
import ErrorPage from '@/views/Error'
// element-ui
import "@/utils/install-elementui"
import {getMatemask} from '@/utils/matemask'
// vuex
import store from  '@/store'
// 全局过滤器
import '@/filter'
// 图片懒加载
import VueLazyLoad from 'vue-lazyload'
Vue.use(VueLazyLoad, {
  preLoad: 1,
  loading: require('@/assets/images/loading.gif'),
  attempt: 2,
})

// 自定义全局组件注册
import RandomAvatar from '@/components/RandomAvatar'
Vue.component('RandomAvatar', RandomAvatar)

Vue.config.productionTip = false
// getMatemask().then(result=>{
//   Vue.prototype.$web3 = result
//   new Vue({
//     render: h => h(App),
//     router,
//     store
//   }).$mount('#app')
// }).catch((err)=>{
//   console.log('main err:', err)
//   new Vue({
//     render: h => h(ErrorPage),
//   }).$mount('#app')
// })

new Vue({
  render: h => h(App),
  router,
  store
}).$mount('#app')
